{
GtkMagnifier *magnifier = GTK_MAGNIFIER (widget);
GtkMagnifierPrivate *priv = gtk_magnifier_get_instance_private (magnifier);
- graphene_matrix_t transform;
double width, height, paintable_width, paintable_height;
if (gtk_widget_paintable_get_widget (GTK_WIDGET_PAINTABLE (priv->paintable)) == NULL)
if (paintable_width <= 0.0 || paintable_height <= 0.0)
return;
- graphene_matrix_init_translate (&transform, &GRAPHENE_POINT3D_INIT (
- - CLAMP (priv->x, 0, paintable_width),
- - CLAMP (priv->y, 0, paintable_height),
- 0
- ));
-
- graphene_matrix_scale (&transform, priv->magnification, priv->magnification, 1);
+ gtk_snapshot_save (snapshot);
if (!priv->resize)
- graphene_matrix_translate (&transform, &GRAPHENE_POINT3D_INIT (width / 2, height / 2, 0));
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (width / 2, height / 2));
+ gtk_snapshot_scale (snapshot, priv->magnification, priv->magnification);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (
+ - CLAMP (priv->x, 0, paintable_width),
+ - CLAMP (priv->y, 0, paintable_height)));
- gtk_snapshot_push_transform (snapshot, &transform);
gdk_paintable_snapshot (priv->paintable, snapshot, paintable_width, paintable_height);
- gtk_snapshot_pop (snapshot);
+ gtk_snapshot_restore (snapshot);
}
static void